﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service
{
	// 添加 [WebGet] 属性以使用 HTTP GET
	[OperationContract]
	public void DoWork()
	{
		// 在此处添加操作实现
		return;
	}
    public string WSGettishi(string clientValue)
    {
        SqlConnection sqlcon = new SqlConnection();
        sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
        sqlcon.Open();

        SqlCommand sqlcmd = new SqlCommand("select * from tishi where tishiid=" + clientValue, sqlcon);

        SqlDataReader reader = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);
        string artn="";

        if (reader.Read())
        {

             artn = reader["idmingcheng"].ToString();
        }

        reader.Close();

        sqlcon.Close();


        return artn;
    }
	// 在此处添加更多操作并使用 [OperationContract] 标记它们
}
